package com.mxpio.erp.common.workshop.entity;

import com.mxpio.erp.common.technology.entity.WorkShop;
import com.mxpioframework.jpa.annotation.DictAble;
import com.mxpioframework.security.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

@Data
@Entity
@Table(name = "V_MB_ERP_WORKSHOP_CURMON_FINISH_RATE")
@Schema(description="车间生产订单完成率(统计当月)")//统计生产当月(计划完成时间)
public class VWorkShopCurMonFinishRate implements DictAble, Serializable {
	
	private static final long serialVersionUID = 1L;
	
	@Transient
	private Map<String, String> textMap;

	public String putText(String key, String value) {
		if (textMap == null) {
			textMap = new HashMap<>();
		}
		return textMap.put(key, value);
	}
	@Id
	@Column(name = "WORK_SHOP_CODE_")
	@Schema(description = "所属车间")
	@Dict(dicCode="workShopCode",dicEntity=WorkShop.class,dicText="workShopName")
	private String workShopCode;

	@Column(name = "YEARMON")
	@Schema(description = "当前年月(从订单计划完成日期取)")
	private String yearmon;

	@Column(name = "ORDER_CNT_")
	@Schema(description = "订单数量")
	private BigDecimal orderCnt;

	@Column(name = "DOING_CNT_")
	@Schema(description = "生产中数量")
	private BigDecimal doingCnt;

	@Column(name = "ONTIME_CNT_")
	@Schema(description = "准时数量")
	private BigDecimal ontimeCnt;

	@Column(name = "DELAY_CNT_")
	@Schema(description = "延期数量")
	private BigDecimal delayCnt;

	@Column(name = "finish_percent_")
	@Schema(description = "完成率（%）")
	private BigDecimal finishPercent;

	@Column(name = "ontime_percent_")
	@Schema(description = "及时完成率（%）")
	private BigDecimal ontimePercent;
}
